libxenlight: Do not build libconfig, but require it as a prerequisite
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 4 Feb 2010 13:16:03 +0000 (13:16 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 4 Feb 2010 13:16:03 +0000 (13:16 +0000)
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/check/check_libconfig_devel [new file with mode: 0755]
tools/libxl/Makefile

diff --git a/tools/check/check_libconfig_devel b/tools/check/check_libconfig_devel
new file mode 100755 (executable)
index 0000000..b35571b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+# CHECK-BUILD
+
+. ./funcs.sh
+
+has_header libconfig.h || fail "missing libconfig headers (package libconfig-devel)"
index 3ddcd4851395f336204d9eed8ba7a1ea0d09e9ea..7bf3199cd8c004ddf565eafbaf121c3f01f468c7 100644 (file)
@@ -14,11 +14,6 @@ CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore)
 
 LIBS = $(LDFLAGS_libxenctrl) $(LDFLAGS_libxenguest) $(LDFLAGS_libxenstore)
 
-#LIBCONFIG_URL ?= http://www.hyperrealm.com/libconfig
-LIBCONFIG_URL = $(XEN_EXTFILES_URL)
-LIBCONFIG_SOURCE = libconfig-1.3.2
-LIBCONFIG_OUTPUT = $(LIBCONFIG_SOURCE)/.libs
-
 LIBXL_OBJS-y = osdeps.o
 LIBXL_OBJS = flexarray.o libxl.o libxl_dom.o libxl_exec.o libxl_xshelp.o libxl_device.o libxl_internal.o xenguest.o libxl_utils.o $(LIBXL_OBJS-y)
 
@@ -39,18 +34,11 @@ libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS)
 libxenlight.a: $(LIBXL_OBJS)
        $(AR) rcs libxenlight.a $^
 
-$(LIBCONFIG_SOURCE).tar.gz:
-       $(WGET) $(LIBCONFIG_URL)/$@
-
-$(LIBCONFIG_OUTPUT)/libconfig.so: $(LIBCONFIG_SOURCE).tar.gz
-       [ ! -d "$(LIBCONFIG_SOURCE)" ] && tar xzf $<
-       cd $(LIBCONFIG_SOURCE) && ./configure --prefix=$(PREFIX) --libdir=$(LIBDIR) --disable-cxx && $(MAKE)
-
-xl.o: $(LIBCONFIG_OUTPUT)/libconfig.so xl.c
-       $(CC) $(CFLAGS) -I$(LIBCONFIG_SOURCE) -c xl.c
+xl.o: xl.c
+       $(CC) $(CFLAGS) -c xl.c
 
-$(CLIENTS): xl.o libxenlight.so $(LIBCONFIG_OUTPUT)/libconfig.so
-       $(CC) $(LDFLAGS) -o $@ $< $(LIBS) -L . -lxenlight -L$(LIBCONFIG_OUTPUT) -lconfig
+$(CLIENTS): xl.o libxenlight.so
+       $(CC) $(LDFLAGS) -o $@ $< $(LIBS) -L . -lxenlight -lconfig
 
 .PHONY: install
 install: all
@@ -60,14 +48,11 @@ install: all
        ln -sf libxenlight.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenlight.so
        $(INSTALL_DATA) libxenlight.a $(DESTDIR)$(LIBDIR)
        $(INSTALL_DATA) libxl.h $(DESTDIR)$(INCLUDEDIR)
-       cd $(LIBCONFIG_SOURCE) && DESTDIR=$(DESTDIR) $(MAKE) install
 
 .PHONY: clean
 clean:
        $(RM) -f *.o *.so* *.a $(CLIENTS) $(DEPS)
-       $(RM) -rf $(LIBCONFIG_SOURCE)
 
 distclean: clean
-       $(RM) -f $(LIBCONFIG_SOURCE).tar.gz
 
 -include $(DEPS)